package com.xiaomaoguai.redis.sub;

import com.xiaomaoguai.redis.entity.MessageModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ FileName: AbstractMessageDelegateAdapter.java
 * @ Author: WeiHui-Z
 * @ Date: 2017/4/21 17:26
 * @ Version: v1.0.0
 */
public abstract class AbstractMessageDelegateAdapter implements MessageDelegate {

    protected final Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public void handleMessage(MessageModel messageModel, String channel) {
        logger.info("订阅到:[{}]的消息", channel);
        logger.info("消息内容:[{}]", messageModel);
        handel(messageModel);
    }

    protected void handel(MessageModel messageModel) {
    }
}
